import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
import './style/index.css'
Vue.use(ViewUI);

Vue.prototype.$color = '#ff5a6b';
import axios from 'axios'
// 配置请求根路径
axios.defaults.baseURL = 'http://sblog.aqgy.xyz/'
//axios.defaults.baseURL = 'http://vfrp.aqgy.xyz/'
axios.interceptors.request.use(config =>{

    const redata = JSON.parse(window.sessionStorage.getItem("user"));
    if (redata == null){
        config.headers.Authorization = null;

    }else {
        config.headers.Authorization = redata.token;
    }

    //必须返回config
    return config;
})
Vue.prototype.$http = axios
//微信二维码请求地址
Vue.prototype.$getcodeurl ='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket='
//websocket通信地址
Vue.prototype.$wsUrl = 'sblog.aqgy.xyz:8082/'
//Vue.prototype.$wsUrl = 'vfrp.aqgy.xyz:8088/'

//上传图片地址
Vue.prototype.$uploadImage = 'http://sblog.aqgy.xyz/'

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
